#pragma once 
#include "common.hpp"
#include"reactor.hpp"

class Reactor;

using func_t = function<string(string &)>;
class Connection
{

public:
  Connection() : _events(0), _owner(nullptr) {}

  virtual void Recver() = 0;
  virtual void Sender() = 0;
  virtual void Excepter() = 0;
  virtual int GetSockFd() = 0;

  void Setevents(uint32_t events)
  {
    _events = events;
  }
  int32_t Getevents() { return _events; }

  void Setowner(Reactor *owner) { _owner = owner; }
  Reactor *Getowner() { return _owner; }
   void Setfunc(func_t ft){ _func=ft;}
  ~Connection() {}

private:
  uint32_t _events;
  Reactor *_owner;
 public://必须放开 公有继承
  func_t _func;
};